Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@tiptap/extension-hard-break
Advanced tools
@tiptap/extension-hard-break is an extension for the Tiptap editor that allows users to insert hard line breaks (similar to pressing Shift+Enter in a traditional text editor). This is useful for creating new lines within a paragraph without starting a new paragraph.
Insert Hard Break
This feature allows users to insert a hard break into the text. The code sample demonstrates how to import the HardBreak extension and use the setHardBreak command to insert a hard break at the current cursor position.
import { HardBreak } from '@tiptap/extension-hard-break';
const editor = new Editor({
extensions: [
HardBreak,
],
});
// Use the command to insert a hard break
editor.commands.setHardBreak();
Custom Key Bindings
This feature allows users to configure custom key bindings for inserting hard breaks. The code sample shows how to configure the HardBreak extension to insert a hard break when the user presses 'Mod-Enter' (Cmd-Enter on Mac or Ctrl-Enter on Windows).
import { HardBreak } from '@tiptap/extension-hard-break';
const editor = new Editor({
extensions: [
HardBreak.configure({
keymap: {
'Mod-Enter': () => editor.commands.setHardBreak(),
},
}),
],
});
The prosemirror-schema-basic package provides a basic schema for ProseMirror, including support for hard breaks. It is more general-purpose compared to @tiptap/extension-hard-break, which is specifically designed for Tiptap.
Draft.js is a rich text editor framework for React that includes support for hard breaks. While it offers similar functionality, it is a more comprehensive solution for building rich text editors and is not specifically tailored to Tiptap.
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
hard break extension for tiptap
The npm package @tiptap/extension-hard-break receives a total of 692,482 weekly downloads. As such, @tiptap/extension-hard-break popularity was classified as popular.
We found that @tiptap/extension-hard-break demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.